# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AuthorizedBuyersMarketplace.V1.Model.DeliveryControl do
  @moduledoc """
  Message contains details about how the deal will be paced.

  ## Attributes

  *   `companionDeliveryType` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies roadblocking in a main companion lineitem.
  *   `creativeRotationType` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies strategy to use for selecting a creative when multiple creatives of the same size are available.
  *   `deliveryRateType` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies how the impression delivery will be paced.
  *   `frequencyCap` (*type:* `list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.FrequencyCap.t)`, *default:* `nil`) - Output only. Specifies any frequency caps. Cannot be filtered within ListDealsRequest.
  *   `roadblockingType` (*type:* `String.t`, *default:* `nil`) - Output only. Specifies the roadblocking type in display creatives.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :companionDeliveryType => String.t() | nil,
          :creativeRotationType => String.t() | nil,
          :deliveryRateType => String.t() | nil,
          :frequencyCap =>
            list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.FrequencyCap.t()) | nil,
          :roadblockingType => String.t() | nil
        }

  field(:companionDeliveryType)
  field(:creativeRotationType)
  field(:deliveryRateType)

  field(:frequencyCap,
    as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.FrequencyCap,
    type: :list
  )

  field(:roadblockingType)
end

defimpl Poison.Decoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.DeliveryControl do
  def decode(value, options) do
    GoogleApi.AuthorizedBuyersMarketplace.V1.Model.DeliveryControl.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.DeliveryControl do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
